<?php
namespace app\common\model\mysql;

use think\Model;
class MallAdminUser extends Model{
	// 根据用户名获取用户信息数据
	public function getAdminUserByUsername($username){
		if(empty($username)){
			return false;
		}

		$where = [
			"username" => trim($username)
		];

		$result = $this->where($where)->find();
		return $result;
	}

	//根据主键ID更新用户信息
	public function updateAdminUserByUserId($id,$data){
		$id = intval($id);
		if(empty($id) || empty($data) || !is_array($data)){
			return false;
		}

		$where = [
			"id" => $id,
		];

		return $this->where($where)->save($data);
	}
}